package com.ruoyi.project.module.order.controller;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.config.RuoYiConfig;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.module.order.domain.Order;
import com.ruoyi.project.module.order.service.IOrderService;
import com.ruoyi.project.module.order.service.impl.OrderServicePlusImpl;
import com.ruoyi.project.module.report.service.impl.ReportServicePlusImpl;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;

/**
 * 订单管理Controller
 * 
 * @author javen
 * @date 2020-12-24
 */
@Controller
@RequestMapping("/module/order")
public class OrderControllerPlus {

    @Autowired
    private OrderServicePlusImpl orderService;

    /**
     * 上传报告
     */
    @PostMapping("/upload")
    @ResponseBody
    public AjaxResult uploadFile(MultipartFile file) {
        try {
            AjaxResult result = AjaxResult.success();
            orderService.uploadInvoice(file,result);
            return result;
        }
        catch (Exception e) {
            return AjaxResult.error(e.getMessage());
        }
    }

}
